package com.ctshk.rpc.order.custom.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.rpc.order.custom.dto.order.CustomOrderDiscountListDTO;
import com.ctshk.rpc.order.custom.req.order.*;

import java.math.BigDecimal;

/**
 * <p>
 * 折扣记录 服务类
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-02-22
 */
public interface ICustomizedOrderDiscountService {

    /**
     * 折扣记录列表
     * @param req
     * @return
     */
    PageResponse<CustomOrderDiscountListDTO> list(CustomOrderIdReq req);

    /**
     * 使用折扣
     * @param req
     * @return
     */
    Result add(CustomOrderDiscountAddReq req);

    /**
     * 编辑折扣
     * @param req
     * @return
     */
    Result edit(CustomOrderDiscountEditReq req);

    /**
     * 删除折扣
     * @param req
     * @return
     */
    Result delete(CustomOrderDiscountIdReq req);

    /**
     * 提交審批
     * @param req
     * @return
     */
    Result approval(CustomOrderDiscountAddReq req);

    /**
     * 清空订单折扣记录
     * @param orderId
     * @param userId
     * @return
     */
    boolean cleanByOrder(Long orderId,Long userId);

    /**
     * 查询旅客折扣金额
     * @param orderId
     * @param touristId
     * @return
     */
    BigDecimal sumAmountByTourist(Long orderId, Long touristId);

    /**
     * 清空旅客订单折扣记录
     * @param orderId
     * @param touristId
     * @param userId
     * @return
     */
    boolean cleanByTourist(Long orderId,Long touristId,Long userId);

    /**
     * 審批
     * @param req
     * @return
     */
    Result passApproval(CustomOrderDiscountApprovalReq req);

    /**
     * 撤回
     * @param req
     * @return
     */
    Result withdraw(CustomOrderDiscountIdReq req);
}
